<?php

/**
 * Description of Acl this is a main calss to authorize the users and give them the permssions.
 *
 * @author Suraj
 */
class Model_Acl extends Zend_Acl{
    public function __construct () {
        // role defination
        $this->addRole(new Zend_Acl_Role("guest"));
        $this->addRole(new Zend_Acl_Role("user"), "guest");
        $this->addRole(new Zend_Acl_Role("blogger"),"user");
        $this->addRole(new Zend_Acl_Role("admin"),"blogger");

        // resource defination
        $this->addResource("posts");
        $this->addResource("comments");

        //access specifiers
        $this->allow('guest','posts','view');
        $this->allow('user','comments','add');
        $this->allow('blogger','posts','add');
        $this->allow('blogger','posts','edit');
        $this->allow('admin','posts','delete');
        $this->allow('admin','comments','edit');
        $this->allow('admin','comments','delete');
    }
}
?>
